﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace PokeTD_MapEditor
{
    public partial class NeuesTile : Form
    {
        public NeuesTile()
        {
            InitializeComponent();
        }

        string _fileName = "";

        public bool Walkable {
            get { return cbBegehbar.Checked; }
        }
        public string FileName {
            get { return _fileName; }
            set { _fileName = value; }
        }
        private void bttnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "PNG-Dateien|*.png";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                txtPath.Text = ofd.FileName;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!txtPath.Text.Equals("") && File.Exists(txtPath.Text)) {
                _fileName = txtPath.Text;
                this.Close();
            } else {
                MessageBox.Show("Keinen gültigen Pfad ausgewählt");
            }
        }

        private void btnAbbrechen_Click(object sender, EventArgs e) {
            this.Close();
        }
    }
}
